//二分+前缀和 最大平均子序列
#include<bits/stdc++.h> 
using namespace std;
int main( )
{
    int n=0,depth=0;
    cin>>n>>depth;
    double arr[n];
    double sum[n];
    double l=10000001,r=0,m=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        if(arr[i]>r)
        {
            r=arr[i];
        }
        if(arr[i]<l)
        {
            l=arr[i];
        }
    }
   
    // cout<<l<<"-"<<r<<endl;
    while(r-l>0.0000001)
    {
        m=(r-l)/2+l;
 
        //判断m是否满足
        int flag=0;
        sum[0]=arr[0]-m;
        for(int i=1;i<n;i++)
        {
            sum[i]=sum[i-1]+arr[i]-m;
        }
        double min=0;
        for(int j=depth-1;j<n;j++)
        {
            if(j>=depth&&sum[j-depth]<min)
                min=sum[j-depth];
            if(sum[j]>=min)
            {
                flag=1;
                break;
            }
        }
        //判断+更新
        //cout<<l<<" "<<m<<" "<<r<<" "<<flag<<endl;
        if(flag)
        {
            l=m;
        }
        else
        {
            r=m;
        }
    }
    cout<< int(r*1000);
    //  cout<< floor(r*1000);  error  ??
    return 0;
}

//模拟-字符串相乘
char* addStrings(char* num1, char* num2) {
    int i = strlen(num1) - 1, j = strlen(num2) - 1, add = 0;
    char* ans = malloc(sizeof(char) * (i + j + 5));
    int ansLen = 0;
    while (i >= 0 || j >= 0 || add != 0) {
        int x = i >= 0 ? num1[i] - '0' : 0;
        int y = j >= 0 ? num2[j] - '0' : 0;
        int result = x + y + add;
        ans[ansLen++] = result % 10;
        add = result / 10;
        i--;
        j--;
    }
    for (int i = 0; i < ansLen / 2; i++) {
        char t = ans[i];
        ans[i] = ans[ansLen - 1 - i];
        ans[ansLen - 1 - i] = t;
    }
    for (int i = 0; i < ansLen; i++) {
        ans[i] += '0';
    }
    ans[ansLen++] = 0;
    return ans;
}

char* multiply(char* num1, char* num2) {
    int m = strlen(num1), n = strlen(num2);
    char* ans = malloc(sizeof(char) * 2);
    ans[0] = '0', ans[1] = 0;
    if ((m == 1 && num1[0] == '0') || (n == 1 && num2[0] == '0')) {
        return ans;
    }
    for (int i = n - 1; i >= 0; i--) {
        char* curr = malloc(sizeof(char) * (n + m + 5));
        int currLen = 0;
        int add = 0;
        for (int j = n - 1; j > i; j--) {
            curr[currLen++] = 0;
        }
        int y = num2[i] - '0';
        for (int j = m - 1; j >= 0; j--) {
            int x = num1[j] - '0';
            int product = x * y + add;
            curr[currLen++] = product % 10;
            add = product / 10;
        }
        while (add != 0) {
            curr[currLen++] = add % 10;
            add /= 10;
        }
        for (int i = 0; i < currLen / 2; i++) {
            char t = curr[i];
            curr[i] = curr[currLen - 1 - i];
            curr[currLen - 1 - i] = t;
        }
        for (int i = 0; i < currLen; i++) {
            curr[i] += '0';
        }
        curr[currLen++] = 0;
        char* tmp = addStrings(ans, curr);
        free(ans), free(curr);
        ans = tmp;
    }
    return ans;
}


//oj
#include<stdio.h>
int main() 
{ 
    int n=0;
    scanf("%d",&n);
    char s[2501]={0};
    scanf("%s",s);
    for(int i=1;i<=n*n;i++)
    {
        int num=0;
        //0 - i%n-1
        for(int index=0;index<i%n;index++)
        {
            if(s[index]=='1')
            {
                num++;
                break;
            }
        }
        for(int j=0;j<i/n;j++)
        {
            for(int index=i%n+n*j;index<i%n+n*(j+1);index++)
            {
                if(s[index]=='1')
                {
                    num++;
                    break;
                }
            }
        }
        printf("%d ",num);

    }
    
    return 0; 
}

//杨辉三角-二维数组
int** generate(int numRows, int* returnSize, int** returnColumnSizes) {
    int** ret = malloc(sizeof(int*) * numRows);
    *returnSize = numRows;
    *returnColumnSizes = malloc(sizeof(int) * numRows);
    for (int i = 0; i < numRows; ++i) {
        ret[i] = malloc(sizeof(int) * (i + 1));
        (*returnColumnSizes)[i] = i + 1;
        ret[i][0] = ret[i][i] = 1;
        for (int j = 1; j < i; ++j) {
            ret[i][j] = ret[i - 1][j] + ret[i - 1][j - 1];
        }
    }
    return ret;
}

//哈希
char * getHint(char * secret, char * guess){
    short countA = 0, countB = 0;   
    short secretleft[10] = {0}, guessleft[10] = {0};
    for (short i = 0; i < strlen(secret); ++ i)
        if (secret[i] == guess[i])     ++ countA;
        else{
            if (guessleft[secret[i] - 0x30] == 0) ++ secretleft[secret[i] - 0x30];
            else{                      ++ countB; -- guessleft[secret[i] - 0x30];}               
            if (secretleft[guess[i] - 0x30] == 0) ++ guessleft[guess[i] - 0x30];
            else{                      ++ countB; -- secretleft[guess[i] - 0x30];}
        }
    char * str = malloc(sizeof(char) * 9);
    sprintf(str, "%dA%dB", countA, countB);
    return str;
}


//百度班选拔
int maxArea(int* height, int heightSize){
    int square=0;
    int left =0;
    int right=heightSize-1;
    while(left<right)
   {
        int min=fmin(height[left],height[right]); 
        square=fmax(square,(right-left)*min);
        if(height[left]>height[right])
        {   
            right--;
        }
        else
        {
            left++;
        }
    }
     return square;
}


int pivotIndex(int* nums, int numsSize) {
    int total = 0;
    for (int i = 0; i < numsSize; ++i) 
    {
        total += nums[i];
    }
    int sum = 0;
    for (int i = 0; i < numsSize; ++i) 
    {
        if (2 * sum + nums[i] == total)
        {
            return i;
        }
        sum += nums[i];
    }
    return -1;
}


//动态规划
int rob(int* nums, int numsSize){
int i=0,ans=0,q=0,p=0;
for(i=0;i<numsSize;i++)
{
ans=fmax(p+nums[i],q);//上上次p的加本次nums[i] 与 上次的金额q比较
p=q;//记录上上次的金额
q=ans;//记录当前的房间达到的金额
}
return ans;
}


//动态规划
bool isInterleave(char* s1, char* s2, char* s3) {
    int n = strlen(s1), m = strlen(s2), t = strlen(s3);

    int f[n + 1][m + 1];
    memset(f, 0, sizeof(f));

    if (n + m != t) {
        return false;
    }

    f[0][0] = true;
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= m; ++j) {
            int p = i + j - 1;
            if (i > 0) {
                f[i][j] |= (f[i - 1][j] && s1[i - 1] == s3[p]);
            }
            if (j > 0) {
                f[i][j] |= (f[i][j - 1] && s2[j - 1] == s3[p]);
            }
        }
    }

    return f[n][m];
}

//复原ip地址
#define SEG_COUNT 4
int segments[SEG_COUNT];
char** ans;
int ans_len;

void dfs(char* s, int segId, int segStart) {
    // 如果找到了 4 段 IP 地址并且遍历完了字符串，那么就是一种答案
    int len_s = strlen(s);
    if (segId == SEG_COUNT) {
        if (segStart == len_s) {
            char* ipAddr = (char*)malloc(sizeof(char) * (len_s + 4));
            int add = 0;
            for (int i = 0; i < SEG_COUNT; ++i) {
                int number = segments[i];
                if (number >= 100) {
                    ipAddr[add++] = number / 100 + '0';
                }
                if (number >= 10) {
                    ipAddr[add++] = number % 100 / 10 + '0';
                }
                ipAddr[add++] = number % 10 + '0';
                if (i != SEG_COUNT - 1) {
                    ipAddr[add++] = '.';
                }
            }
            ipAddr[add] = 0;
            ans = realloc(ans, sizeof(char*) * (ans_len + 1));
            ans[ans_len++] = ipAddr;
        }
        return;
    }

    // 如果还没有找到 4 段 IP 地址就已经遍历完了字符串，那么提前回溯
    if (segStart == len_s) {
        return;
    }

    // 由于不能有前导零，如果当前数字为 0，那么这一段 IP 地址只能为 0
    if (s[segStart] == '0') {
        segments[segId] = 0;
        dfs(s, segId + 1, segStart + 1);
    }

    // 一般情况，枚举每一种可能性并递归
    int addr = 0;
    for (int segEnd = segStart; segEnd < len_s; ++segEnd) {
        addr = addr * 10 + (s[segEnd] - '0');
        if (addr > 0 && addr <= 0xFF) {
            segments[segId] = addr;
            dfs(s, segId + 1, segEnd + 1);
        } else {
            break;
        }
    }
}

char** restoreIpAddresses(char* s, int* returnSize) {
    ans = (char**)malloc(0);
    ans_len = 0;
    dfs(s, 0, 0);
    (*returnSize) = ans_len;
    return ans;
}


//幸运的三
#include<stdio.h>
int main() 
{ 
    int n=0;
    int ret=0;
    int sur0=0,sur1=0,sur2=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&ret);
        if(ret%3==0)
        sur0++;
        else if(ret%3==1)
        sur1++;
        else
        sur2++;
    }
    int sum=0;
    if(sur1<sur2)
    {
        sum=sur0/2+sur1;
    }
    else
    {
       sum=sur0/2+sur2;
    }
    //printf("%d %d %d\n",sur0,sur1,sur2);
    printf("%d",sum);

    return 0; 
}
//连续的串
#include<stdio.h>
int main() 
{ 
    int arr[26][26]={0};
    int n=0;
    scanf("%d",&n);
    getchar();
    char front=getchar();
    char c=0;
    for(int i=0;i<n-1;i++)
    {
        c=getchar();
        arr[front-'A'][c-'A']++;
        // printf("%c- %c-\n",front,c);
        // printf("%d :%d :%d\n",arr[front-'A'][c-'A'],front-'A',c-'A');
        front=c;      
    }
    int max=-1;
    int i,j,ri,rj;
    for(i=0;i<26;i++)
    {
        for(j=0;j<26;j++)
        {
            if(arr[i][j]>max)
            {
                max=arr[i][j];
                ri=i,rj=j;
            }
        }     
    }
    printf("%c%c",'A'+ri,'A'+rj);
    return 0; 
}
//字符串处理-动态规划
bool isInterleave(char* s1, char* s2, char* s3) {
    int n = strlen(s1), m = strlen(s2), t = strlen(s3);

    int f[n + 1][m + 1];
    memset(f, 0, sizeof(f));

    if (n + m != t) {
        return false;
    }

    f[0][0] = true;
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= m; ++j) {
            int p = i + j - 1;
            if (i > 0) {
                f[i][j] |= (f[i - 1][j] && s1[i - 1] == s3[p]);
            }
            if (j > 0) {
                f[i][j] |= (f[i][j - 1] && s2[j - 1] == s3[p]);
            }
        }
    }

    return f[n][m];
}


//动态规划
int numDecodings(char* s) {
    int n = strlen(s);
    int f[n + 1];
    memset(f, 0, sizeof(f));
    f[0] = 1;
    for (int i = 1; i <= n; ++i) {
        if (s[i - 1] != '0') {
            f[i] += f[i - 1];
        }
        if (i > 1 && s[i - 2] != '0' && ((s[i - 2] - '0') * 10 + (s[i - 1] - '0') <= 26)) {
            f[i] += f[i - 2];
        }
    }
    return f[n];
}


//外观数列
char * countAndSay(int n){
    char *s = (char *)malloc(sizeof(char) * (n * n * n * 2  + 1));
    char *t = (char *)malloc(sizeof(char) * (n * n * n * 2  + 1));
    *s = '1';
    *(s + 1) = '\0';
    for(int i = 1; i < n;i++){
        char ch,*p,*q;
        int count = 1;
        p = s  + 1;
        ch = *s;
        q = t;
        while(ch && *p){
            if(ch != *p){
                *q = count + '0';
                *(q + 1) = ch;
                count = 1;
                q += 2;
            }else count ++;
            ch = *p;
            p++;
        }
        *q = count + '0';
        *(q + 1) = ch;`
        *(q + 2) = '\0';
        char *x = t;
        t = s;
        s = x;
    }
    return s;
}

//等差素数列
#include<math.h>
int f(int n)
{
  for(int i=2;i<=sqrt(n);i++)
  {
    if(n%i==0)
    return 0;
  }
  return 1;
}
int main(int argc, char *argv[])
{
  int arr[10000];
  int index=0;
  for(int i=2;index<10000;i++)
  {
    if(f(i))
    arr[index++]=i;
  }
          printf("%d",arr[9999]);

  for(int gap=210;gap<211;gap++)
  {
    int c=0;
    for(int i=0;i<9990;i++)
    {
      if(arr[i+1]-arr[i]==gap)
      {
        c++;
        printf("?%d ",c);
        if(c==9)
        {
          printf("%d",gap);
          exit(0);
        }
      }
      else
      {
        if(i>9987)
        //printf("?%d ",c);

        c=0;
      }
    }
  }
          //printf("%d",arr[3999]);
  
  return 0;
}
//后缀表达式
#include<stdio.h>
int main()
{
    int m,n,i,min=0,max=0;
    int a[300000];
    scanf("%d",&m);
    getchar();
    scanf("%d",&n);
    for(i=0;i<n+m+1;i++)
    {
        getchar();
        scanf("%d",&a[i]);
    }
    if(n!=0)
{
    min=a[0];
    max=a[0];
    for(i=0;i<m+n+1;i++)
    {
        if(a[i]<min)
        min=a[i];
        if(a[i]>max)
        max=a[i];
        if(a[i]<0)
        {
            a[i]=-a[i];
        }
    }
}
    long ans=0;
    for(i=0;i<n+m+1;i++)
    {
        ans+=a[i];
    }
    if(min>0)
    ans-=2*min;
    if(max<0)
    ans+=2*max;
    printf("%ld",ans);
}
//链表-设计一个简化版的推特(Twitter)，可以让用户实现发送推文，关注/取消关注其他用户，能够看见关注人（包括自己）的最近 10 条推文
#define MAX 100
typedef struct
{
    int userID;
    int newsCount;
    int newsID[MAX];
    int newstime[MAX];
    int followCount;
    int followID[MAX];
} Twitter;

/** Initialize your data structure here. */
int g_time = 0;
Twitter *twitterCreate()
{
    Twitter *twitterDataBase = NULL;
    twitterDataBase = (Twitter *)malloc(sizeof(Twitter) * MAX);
    memset(twitterDataBase, 0, sizeof(Twitter) * MAX);
    return twitterDataBase;
}

/** Compose a new tweet. */
void twitterPostTweet(Twitter *obj, int userId, int tweetId)
{
    obj[userId].newsID[obj[userId].newsCount] = tweetId;
    obj[userId].newstime[obj[userId].newsCount] = g_time;
    obj[userId].newsCount++;
    g_time++;
}

typedef struct{
    int tempnewsId;
    int tempTime;
} Twitter1;

int compare(const void *a, const void *b)
{
    Twitter1 *x = (Twitter1 *)a;
    Twitter1 *y = (Twitter1 *)b;
    return (*y).tempTime - (*x).tempTime;
}


/** Retrieve the 10 most recent tweet ids in the user's news feed. Each item in the news feed must be posted by users who the user followed or by the user herself. Tweets must be ordered from most recent to least recent. */
int *twitterGetNewsFeed(Twitter *obj, int userId, int *retSize)
{
    //先算一共有多少条id
    //排序一下
    int newscount = 0;
    Twitter1 temp[MAX] = {0};
    for (int i = 0; i < obj[userId].followCount; i++)
    {
        for (int j = 0; j < obj[obj[userId].followID[i]].newsCount; j++)
        {   
            temp[newscount].tempnewsId = obj[obj[userId].followID[i]].newsID[j];
            temp[newscount].tempTime = obj[obj[userId].followID[i]].newstime[j];
            newscount++;
        }
    }

    for (int i = 0; i < obj[userId].newsCount; i++)
    {   
        temp[newscount].tempnewsId = obj[userId].newsID[i];
        temp[newscount++].tempTime = obj[userId].newstime[i];
    }

    qsort(temp, newscount, sizeof(Twitter1), compare);

    int reslen = newscount;
    if (newscount > 10)
    {
        reslen = 10;
    }
    *retSize = reslen;
    int *res = (int *)malloc(sizeof(int) * reslen);
    memset(res, 0, sizeof(int) * reslen);
    for (int i = 0; i < reslen; i++)
    {
        printf("%d\n", temp[i].tempnewsId);
        res[i] = temp[i].tempnewsId;
    }
    return res;
}

/** Follower follows a followee. If the operation is invalid, it should be a no-op. */
void twitterFollow(Twitter *obj, int followerId, int followeeId)
{   
    for(int i =0 ; i < obj[followerId].followCount; i++)
    {
        if(obj[followerId].followID[i] == followeeId) {
            return;
        }
    }
    obj[followerId].followID[obj[followerId].followCount] = followeeId;
    obj[followerId].followCount++;
}

/** Follower unfollows a followee. If the operation is invalid, it should be a no-op. */
void twitterUnfollow(Twitter *obj, int followerId, int followeeId)
{   
    if (obj[followerId].followCount > 0)
    {
        obj[followerId].followID[obj[followerId].followCount] = 0;
        obj[followerId].followCount--;
    }
}

void twitterFree(Twitter *obj)
{
    free(obj);
}

//
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
  int arr[12]={31,28,31,30,31,30,31,31,30,31,30,31};
  int year[]={12,12,12,12,12,
              12,12,12,12,12,
              12,12,12,12,12,
              12,12,12,12,12,9};
  int weekday=6;
  int c=0;
  for(int i=0;i<21;i++)
  {
    //2020+i 年
    if(i%4==0)
    {
      arr[1]=29;
    }
    else
      arr[1]=28;
    for(int index=0;index<year[i];index++)
    {
      //index+1 月
      for(int day=1;day<=arr[index];day++)
      {
        // day 号
        if(weekday==1)
        {
          c+=2;
        }
        else if(day==1)
        {
          c+=2;
        }
        else
        {
          c+=1;
        }
        weekday=weekday+1;
        if(weekday==8)
        weekday=1;
      }
    }
  }
  printf("%d",c+2);
  return 0;
}//回溯法全排列
void swap(int * nums,int indexA,int indexB)
{
    int temp    = nums[indexA];
    nums[indexA]= nums[indexB];
    nums[indexB]= temp;
}

void prem(int* nums, int numsSize, int* returnSize, int** returnColumnSizes,int** returnNums,int offset)
{
    if(offset == numsSize)
    {
        //遍历到末尾了
        //申请returnNums
        returnNums[*returnSize] = (int *)malloc(sizeof(int ) * numsSize);
        //拷贝内容到returnNums
        memcpy(returnNums[*returnSize],nums,sizeof(int) * numsSize );
        //记录当前拷贝内容的长度
        (*returnColumnSizes)[*returnSize] = numsSize;
        *returnSize = *returnSize + 1;

    }
    else
    {

        //回溯算法的核心
        int i;
        for(i = offset; i < numsSize; i++)
        {
            swap(nums,i,offset);//i 和 offset 交换
            prem(nums,numsSize,returnSize,returnColumnSizes,returnNums,offset+1);
            swap(nums,i,offset);//i 和 offset 交换
        }
    }
}


int** permute(int* nums, int numsSize, int* returnSize, int** returnColumnSizes)
{
    //不重复的数字的全排序
    //组合次数为 n！= n *( n - 1) *( n - 2) ...... 2 * 1
    //这样的方法适合回溯的方法
    //取值范围1 <= nums.length <= 6  = 6 * 5 * 4 * 3 *2 * 1 = 720中可能
    int **returnNums = (int **)malloc(sizeof(int *) * 721);
    *returnColumnSizes= (int *)malloc(sizeof(int ) * 721);
    *returnSize = 0;
    prem(nums,numsSize,returnSize,returnColumnSizes,returnNums,0);
    return returnNums;

}


//排序
void swap(int *a, int *b) {
    int t = *a;
    *a = *b, *b = t;
}

void sortColors(int *nums, int numsSize) {
    int ptr = 0;
    for (int i = 0; i < numsSize; ++i) {
        if (nums[i] == 0) {
            swap(&nums[i], &nums[ptr]);
            ++ptr;
        }
    }
    for (int i = ptr; i < numsSize; ++i) {
        if (nums[i] == 1) {
            swap(&nums[i], &nums[ptr]);
            ++ptr;
        }
    }
}


//双指针
int maxArea(int* height, int heightSize){
    int square=0;
    int left =0;
    int right=heightSize-1;
    while(left<right){
        int min=fmin(height[left],height[right]); //找出可对应的两条边（由于会出现一边高，一边低的现象，因此需要就低原则）
        square=fmax(square,(right-left)*min);//求出最大面积
        if(height[left]>height[right]){   //让最短的一条边移动，减少花费
            right--;
        }
        else{
            left++;
        }
    }
     return square;
}


int pivotIndex(int* nums, int numsSize) {
    int total = 0;
    for (int i = 0; i < numsSize; ++i) {
        total += nums[i];
    }
    int sum = 0;
    for (int i = 0; i < numsSize; ++i) {
        if (2 * sum + nums[i] == total) {
            return i;
        }
        sum += nums[i];
    }
    return -1;
}

//扫雷游戏
#include<stdio.h>
int fun(int i,int j,int n,int m)
{
    if(i>=0&&i<n&&j>=0&&j<m)
    {
        return 1;
    }
    return 0;
}
int main()
{
    int n=0,m=0;
    scanf("%d %d",&n,&m);
    char s[n][m+10];
    for(int i=0;i<n;i++)
    {
        scanf("%s",s[i]);
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(s[i][j]=='?')
            {
                s[i][j]='0';
                if(fun(i-1,j-1,n,m)&&s[i-1][j-1]=='*')
                {
                    s[i][j]++;
                }
                if(fun(i-1,j,n,m)&&s[i-1][j]=='*')
                {
                    s[i][j]++;
                }
                if(fun(i-1,j+1,n,m)&&s[i-1][j+1]=='*')
                {
                    s[i][j]++;
                }
                if(fun(i,j-1,n,m)&&s[i][j-1]=='*')
                {
                    s[i][j]++;
                }
                if(fun(i,j+1,n,m)&&s[i][j+1]=='*')
                {
                    s[i][j]++;
                }
                if(fun(i+1,j-1,n,m)&&s[i+1][j-1]=='*')
                {
                    s[i][j]++;
                }
                if(fun(i+1,j,n,m)&&s[i+1][j]=='*')
                {
                    s[i][j]++;
                }
                if(fun(i+1,j+1,n,m)&&s[i+1][j+1]=='*')
                {
                    s[i][j]++;
                }
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        printf("%s\n",s[i]);
    }
    
}
//题意important-洛谷乒乓分数制
#include<stdio.h>
int main()
{
    char s[100000]="\0";
    for(int i=0;;++i)
    {
        scanf("%c",&s[i]);
        if(s[i]=='E')
        break;
        if(s[i]=='\n'||s[i]=='\r')
        i--;
    }
    int w=0,l=0;
    for(int i=0;;++i)
    {
        if(s[i]=='E')
        break;
        else if(s[i]=='W')
        ++w;
        else if(s[i]=='L')
        ++l;
        if( (w-l>=2||l-w>=2) && (w>=11||l>=11))
        {
            printf("%d:%d\n",w,l);
            l=0,w=0;
        }
    }
    printf("%d:%d\n\n",w,l);
    
    l=0,w=0;
    
    for(int i=0;;++i)
    {
        if(s[i]=='E')
        break;
        else if(s[i]=='W')
        ++w;
        else if(s[i]=='L')
        ++l;
        if( (w-l>=2||l-w>=2) && (w>=21||l>=21))
        {
            printf("%d:%d\n",w,l);
            l=0,w=0;
        }
    }
    printf("%d:%d\n\n",w,l);
    
    
    
}

#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<stdlib.h>
int cmp(void* a, void* b)
{
	return *(int*)a - *(int*)b;
}
int main()
{
	char a[] = "WHERETHEREISAWILLTHEREISAWAY";
	qsort(a, sizeof(a) / sizeof(a[0]), sizeof(a[0]), cmp);
	printf("%s", a);
	return 0;
	/*
	  int sum=c;
  int n1=a*5+2*b;
  c%=n1;
  if(a*5+b>=c&&c>a*5)
  {
    printf("%d",6+7*(sum/n1));
  }
  else if(a*5+b<c)
  {
    printf("%d",7+7*(sum/n1));
  }
  else
  {
    if(c%a==0)
    printf("%d",c/a+7*(sum/n1));
    else
    printf("%d",1+c/a+7*(sum/n1));
  }*/
}